import { request } from "umi";

// 文章数据
export function benchArticle(page: number = 1) {
    let params = {
        page,
        pageSize: 6,
    }
    return request('/api/article', { params })
}

// 评论数据
export function benchComment(page: number = 1) {
    let params = {
        page,
        pageSize: 6,
    }
    return request('/api/comment', { params })
}

//  通过拒绝接口
export function getbenchCommentDetails(id: any) {
    return request(`/api/comment/${id.id}`, {
        method: "PATCH",
        data: id.data,
    })
}
// 回复
export function getbenchCommentReply(data: any) {
    return request('/api/comment', {
        method: 'POST',
        data: data
    })
}
// 删除
export function getbenchCommentDelete(id: any) {
    return request(`/api/comment/${id.id}`, {
        method: 'DELETE',
    })
}

// 详情编辑数据
export function getArticleDetails(id: any) {
    return request(`/api/article/${id}`)
}
// 详情编辑数据删除
export function getArticleDetailsDelete(id: any) {
    return request(`/api/article/${id}`, {
        method: 'DELETE',
    })
}
// 详情 草稿
export function getArticleDetailsDraft(getArticleDetailsList: any) {
    return request(`/api/article/${getArticleDetailsList.id}`, {
        method: 'PATCH',
        data:getArticleDetailsList
    })
}